package com.jdk.demo.fileInputStream;

import java.io.FileOutputStream;
import java.io.FileInputStream ;

public class FileOutputStreamDemo01 {

    public static void main(String args[]) throws Exception{    // 异常抛出，不处理
    	// 创建文件输入流
		FileInputStream fileInputStream = new FileInputStream("E:/zsl/temp2.txt");
		// 创建文件输出流
		FileOutputStream fileOutputStream =  new FileOutputStream("E:/zsl/temp3.txt");

		// 创建流的最大字节数组
		byte[] inOutBytes = new byte[fileInputStream.available()];
		// 将文件输入流读取，保存至inOutBytes数组
		fileInputStream.read(inOutBytes);
		// 将inOutBytes数组，写出到data.txt文件中
		fileOutputStream.write(inOutBytes);

		fileOutputStream.close();
		fileInputStream.close();
    }

};
